HTTP connector service contract |
Using HTTP connector, an application on Process Platform uses services that are available over HTTP or HTTPS. These services are HTTP services such as web services or REST-based services. Since Process Platform follows SOAP protocol, the web services can be consumed by Process Platform in a format that is understandable by the Platform. HTTP connector transforms the SOAP-based application and Platform messages to the format expected by the service and the other way round.
Response from the external HTTP service will be added to the webservice response root as xml, after the necessary transformations. If the HTTP service response has namespace associated with it, this namespace will be preserved , when adding it to the webservice response. If HTTP response does not have any namespace associated with it, then the namespace of the root element of webservice response will become the namespace of the HTTP response.
When a service is presented to the Process Platform, it must follow the following web service implementation protocol.
Tag Name | Description | Mandatory | Example | ||||
---|---|---|---|---|---|---|---|
implementation | This is the root tag of any service executed by HTTP connector. It must have an attribute called Attributes
|
Yes |
<implementation type="HTTP" xmlns="http://httpconnector.opentext.com/1.0/implementation"> .... </implementation> |
||||
connection-id | ID of the connection to be used for executing the request. This ID must be present in the http connections configuration stored in the XML store. | Yes |
<implementation type="HTTP" xmlns="http://httpconnector.opentext.com/1.0/implementation" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"> <connection-id>TEST-CONNECTION</connection-id> .... </implementation> |
||||
uri | The URI of the external service. This value must be relative to the URI given in the http connection configuration stored in the XML store. The URI can also be parametrized. |
Web service implementation depicting a static URI
<implementation type="HTTP" xmlns="http://httpconnector.opentext.com/1.0/implementation" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"> <connection-id>TEST-CONNECTION</connection-id> <uri>/v2/rss/testrest</uri> .... </implementation>
Web service implementation depicting a parameterized URI
<implementation type="HTTP" xmlns="http://httpconnector.opentext.com/1.0/implementation" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"> <connection-id>TEST-CONNECTION</connection-id> <http-method>GET</http-method> <uri>/v2/rss/testrest/{0}</uri> <request-handler class="com.opentext.applicationconnector.httpconnector.impl.RestRequestHandler"> <uri-parameters> <parameter type="xpath">./Username</parameter> </uri-parameters> </request-handler> .... </implementation> While processing the request, the actual URI is constructed by substituting the value of the |
|||||
http-method | Denotes the HTTP method to be used while executing the service. HTTP connector supports the following methods:
Note: The default value is POST. |
<implementation type="HTTP" xmlns="http://httpconnector.opentext.com/1.0/implementation" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"> <connection-id>TEST-CONNECTION</connection-id> <uri>/v2/rss/testrest</uri> <http-method>GET|POST|PUT|DELETE</http-method> .... </implementation> |
|||||
clean-response-body | If true, the response SOAP body contents get cleared. This is useful only for methods which cannot return the response method element. The default value is false. |
<implementation type="HTTP" xmlns="http://httpconnector.opentext.com/1.0/implementation" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"> <connection-id>TEST-CONNECTION</connection-id> <uri>/v2/rss/testrest</uri> <http-method>GET|POST|PUT|DELETE</http-method> <clean-response-body>true</clean-response-body> .... </implementation> |
|||||
request-handler | Provides various details on request processing. This includes the handlers which process the request, transformation which needs to be applied on request XML. The parameters required for the request are as follows: Attributes
Child elements
|
Yes |
Web service implementation for Non-REST API
<implementation type="HTTP" xmlns="http://httpconnector.opentext.com/1.0/implementation" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"> <connection-id>TEST-CONNECTION</connection-id> <uri>/v2/rss/testnonrest</uri> <request-handler class="com.opentext.applicationconnector.httpconnector.impl.StandardRequestHandler"> .... </request-handler> .... </implementation>
Web service implementation for REST API
<implementation type="HTTP" xmlns="http://httpconnector.opentext.com/1.0/implementation" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"> <connection-id>TEST-CONNECTION</connection-id> <uri>/v2/rss/testrest</uri> <request-handler class="com.opentext.applicationconnector.httpconnector.impl.RestRequestHandler"> .... </request-handler> .... </implementation> |
||||
uri-parameters |
Gives details about the list of parameters required by the service. Each parameter is represented by the parameter element. Child elements
|
<implementation type="HTTP" xmlns="http://httpconnector.opentext.com/1.0/implementation" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"> <connection-id>TEST-CONNECTION</connection-id> <uri>/v2/rss/testrest</uri> <request-handler class="com.opentext.applicationconnector.httpconnector.impl.RestRequestHandler"> <uri-parameters> <parameter type="xpath">./Username</parameter> <parameter type="Fixed">./Tags/Tag</parameter> </uri-parameters> </request-handler> .... </implementation> |
|||||
parameter |
Represents one parameter. Attributes
|
As mentioned in the above example, the connection configuration from the XML store has a STRING typed parameter with name <parameter type="connection-parameter">firstBuild</parameter> In the similar way, you can use the following construct to read the relative path of the connection URL for the given <parameter type="connection-uri" /> Eventually, for the above example, the effective URI is http://buildmaster-hyd.vanenburg.com/jenkins/job/httpconnector-test-wip-linux/102/api/json 102 is the |
|||||
req-headers | Represents custom HTTP headers. These custom HTTP headers are set in the request before an outbound call is made. Child elements
|
<implementation type="HTTP" xmlns="http://httpconnector.opentext.com/1.0/implementation" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"> <connection-id>TEST-CONNECTION</connection-id> <uri>/v2/rss/testrest</uri> <request-handler class="com.opentext.applicationconnector.httpconnector.impl.RestRequestHandler"> <uri-parameters> <parameter type="xpath">./Username</parameter> <parameter type="Fixed">./Tags/Tag</parameter> </uri-parameters> <req-headers> <header name="x-ms-version">2012-03-01</header> <header name="Content-Type">application/xml</header> </req-headers> </request-handler> .... </implementation> |
|||||
root-xpath | HTTP methods PUT and POST accepts payload and denotes the XPath to be applied to extract the payload from a request and send as part of PUT or POST. |
<implementation xmlns="http://httpconnector.opentext.com/1.0/implementation"> <request-handler class="com.opentext.applicationconnector.httpconnector.impl.RestRequestHandler"> <root-xpath>payload/GetTasksForUser</root-xpath> </request-handler> </implementation> |
|||||
response-handler | Provides various details on handling from the service which is accessed. This includes the handlers which can process the response, the transformation which needs to be applied on the response, and so on. Attributes
Child elements
|
<implementation type="HTTP" xmlns="http://httpconnector.opentext.com/1.0/implementation" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"> <connection-id>TEST-CONNECTION</connection-id> <uri>/v2/rss/testrest</uri> <request-handler class="com.opentext.applicationconnector.httpconnector.impl.RestRequestHandler"> <uri-parameters> <parameter type="xpath">./Username</parameter> <parameter type="xpath">./Tags/Tag</parameter> </uri-parameters> </request-handler> <response-handler class="com.opentext.applicationconnector.httpconnector.impl.StandardResponseHandler"> <xslt xmlstore="xslts/response.xslt"/> </response-handler> .... </implementation> |
|||||
valid-response-xpath | XPath expression for validating the response. |
||||||
valid-response-code | HTTP response code for validating the response. |
||||||
namespaces | Holds the namespace prefix mappings that must be used. Child elements
|
||||||
binding | Represents one namespace binding with prefix and URI. Attributes
|
||||||
xslt | The path to XSLT in the XML store used to transform request and response. This can be mentioned both for request handling and response handling. |
<implementation type="HTTP" xmlns="http://httpconnector.opentext.com/1.0/implementation" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"> <connection-id>TEST-CONNECTION</connection-id> <uri>/v2/rss/testrest</uri> <request-handler class="com.opentext.applicationconnector.httpconnector.impl.RestRequestHandler"> <xslt xmlstore="xslts/request.xslt"/> </request-handler> <response-handler class="com.opentext.applicationconnector.httpconnector.impl.StandardResponseHandler"> <xslt xmlstore="xslts/response.xslt"/> </respo nse-handler> .... </implementation> |
Note: For an example on how to develop web services using the HTTP connector, see Developing web services using the HTTP connector.